<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        姓名：{{finalName}}
        <hr>
        姓名：{{finalNameMethod()}}
    </div>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                name:'xiaoming'
            },
            methods:{
                finalNameMethod(){
                    return this.name.slice(0,1).toUpperCase()+this.name.slice(1)
                }
            },
            computed:{
                finalName(){
                    return this.name.slice(0,1).toUpperCase()+this.name.slice(1)
                }
            }
        })
        
    </script>

    

</body>
</html>